<html lang="zh">
<head>
	<meta charset="UTF-8">
	<meta name="viewport"
	      content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
	<meta http-equiv="X-UA-Compatible" content="ie=edge">
	<title>Document</title>
</head>
<body>

</body>
</html>
<script>
	function test(a,b,c) {
		console.log(this.name)
		console.log([...arguments])
	}
	let obj={
		name:"obj"
	};
	let obj2={
		name:"obj2"
	};
	let obj3={
		name:"obj3"
	}
	test.call(obj,1,2,3)
	test.apply(obj2,[1,2,3])
	let fn=test.bind(obj3,1,2,3);
	console.log(fn)
	fn();
	function Func(name){
	   this.name=name
	}
	
	Func.prototype.test=test;
	let func=new Func("a");
	console.log(func)
	console.log(func.name);
	func.test();
	// __proto__ 已经不建议使用了
	//https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Object/proto
	console.log(func.__proto__)
	console.log(Object.getPrototypeOf(func))
	console.log(test.isPrototypeOf(Func))
	class Phone {
		play=()=>{
			console.log("play")
		}
		game(){
			console.log("game")
		}
		static size=20;
	}
	let xiaomi=new Phone();
	class SmartPhone extends Phone{
		play2=()=>{
			console.log("play2")
		}
	}
	console.log(xiaomi)
	console.log(xiaomi.hasOwnProperty("game"))
	console.log(xiaomi.hasOwnProperty("play"))
	let huawei=new SmartPhone();
	console.log(huawei)
	console.log(huawei.hasOwnProperty("play2"))
	console.log(huawei.hasOwnProperty("play"))
	console.log(huawei.hasOwnProperty("game"))
	console.log(SmartPhone.size)
</script>
